package com.xkdx.guangguang.fragment.shopinfo;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.apache.http.entity.mime.content.FileBody;

import android.os.Environment;

import com.xkdx.guangguang.EditerUpload;
import com.xkdx.guangguang.module.network.AbsAction;

public class EditeAction extends AbsAction {
	String userID, shopID, loginToken, infoType, infoTitle, beginTime, endTime, infoContent;

	public EditeAction(String userID, String shopID, String loginToken, String infoType, String infoTitle,
			String beginTime, String endTime, String infoContent) {
		this.userID = userID;
		this.shopID = shopID;
		this.loginToken = loginToken;
		this.infoType = infoType;
		this.infoTitle = infoTitle;
		this.infoContent = infoContent;
		this.beginTime = beginTime;
		this.endTime = endTime;
		key = 4;
		editFileBody = new FileBody(new File(Environment.getExternalStorageDirectory() + "/GuangGuang/photo"
				+ "/edit.jpg"));
		editeCutFileBody = new FileBody(new File(Environment.getExternalStorageDirectory() + "/GuangGuang/photo"
				+ "/editCut.jpg"));
	}

	@Override
	public void constructRequest() {
		HashMap<String, String> map = new HashMap<String, String>();
		map.put("DeviceID", "2");
		map.put("UserID", userID);
		map.put("LoginToken", loginToken);
		map.put("ShopID", shopID);
		map.put("InfoType", infoType);
		map.put("InfoTitle", infoTitle);
		map.put("BeginTime", beginTime);
		map.put("EndTime", endTime);
		map.put("InfoContent", infoContent);
		String json = constructJson(map);
		Parameter parameter = new Parameter("informationInterface", "uploadInfo", json);

		List<Parameter> list = new ArrayList<Parameter>();
		list.add(parameter);
		requestData = constructMod(list);

	}

}
